<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\7\17 0017
 * Time: 10:03
 */
namespace sm_shop\api;
use sm_shop\controller;
use sm_shop\model\couponModel;
use sm_shop\model\customerModel;

class coupon extends controller{

    public function get_list(){

        global $_W;

        if( empty( $_W['customer'] ) ){

            echo json_encode([]);

        }

        $customer_id = $_W['customer']['id'];
        $list =  couponModel::getList( $customer_id );

        echo json_encode( $list );
    }

}